﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        /* phan chu thich cho css */
        .style1
        {
            width: 100%;
        }
        .style2
        {
            color: #FF0000;
            font-size: x-large;
        }
        .style3
        {
            width: 1370px;
            height: 166px;
            margin-left: 0px;
            margin-bottom: 0px;
        }
    </style>
</head>
<body style="text-align: left">
    <form id="form1" runat="server">
    <div>
    
        <table class="style1" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="center" bgcolor="#FFFF99" class="style2">
                    <img alt="" class="style3" src="Image/banner%20atm.jpg" /></td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="Center" bgcolor="#FFFF99" class="style2">
                    <strong>THÊM KHU VỰC ATM</strong></td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <table class="style1" align="left">
                        <tr>
                            <td align="Center">
                                <asp:Label ID="Label1" runat="server" Text="MÃ KHU VỰC" Font-Bold="True" 
                                    Font-Size="Large" ForeColor="#3333CC"></asp:Label>
                                <asp:TextBox ID="txtmakv" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="Center">
                                <asp:Label ID="Label2" runat="server" Text="TỈNH" Font-Bold="True" 
                                    Font-Size="Large" ForeColor="#3333CC"></asp:Label>
                              
                                 &nbsp;&nbsp;  &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;
                                 <asp:TextBox ID="txttinh" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="Center">
                                <asp:Button ID="btthemkv" runat="server" Text="Thêm" onclick="btthemkv_Click" />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="btxoakv" runat="server" Text="Xóa" onclick="btxoakv_Click" />
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="btsuakv" runat="server" Text="Sửa" onclick="btsuakv_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td align="Center">
                                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                    AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                                    BorderColor="#999999" BorderStyle="None" BorderWidth="3px" CellPadding="3" 
                                    DataKeyNames="MaKhuVuc" DataSourceID="Sqldatakhuvuc" GridLines="Vertical">
                                    <AlternatingRowStyle BackColor="#DCDCDC" />
                                    <Columns>
                                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                        <asp:BoundField DataField="MaKhuVuc" HeaderText="Mã khu vực" 
                                            InsertVisible="False" ReadOnly="True" SortExpression="MaKhuVuc" />
                                        <asp:BoundField DataField="Tinh" HeaderText="Tỉnh" SortExpression="Tinh" />
                                    </Columns>
                                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                    <SortedAscendingHeaderStyle BackColor="#0000A9" />
                                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                    <SortedDescendingHeaderStyle BackColor="#000065" />
                                </asp:GridView>
                                <asp:SqlDataSource ID="Sqldatakhuvuc" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:VietComBankConnectionString %>" 
                                    DeleteCommand="DELETE FROM [KhuVuc] WHERE [MaKhuVuc] = @MaKhuVuc" 
                                    InsertCommand="INSERT INTO [KhuVuc] ([Tinh]) VALUES (@Tinh)" 
                                    SelectCommand="SELECT * FROM [KhuVuc]" 
                                    UpdateCommand="UPDATE [KhuVuc] SET [Tinh] = @Tinh WHERE [MaKhuVuc] = @MaKhuVuc">
                                    <DeleteParameters>
                                        <asp:Parameter Name="MaKhuVuc" Type="Int32" />
                                    </DeleteParameters>
                                    <InsertParameters>
                                        <asp:Parameter Name="Tinh" Type="String" />
                                    </InsertParameters>
                                    <UpdateParameters>
                                        <asp:Parameter Name="Tinh" Type="String" />
                                        <asp:Parameter Name="MaKhuVuc" Type="Int32" />
                                    </UpdateParameters>
                                </asp:SqlDataSource>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
